<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>{{title}}</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <style>
        .media-object {
            width:60px;
            height:60px;
            border-radius: 50%;
        }
        .media-body {
            padding-left:10px;
        }
        .media {
            cursor: pointer;
        }
    </style>

</head>
<body style="padding-top:60px;">
<!--导航的内容-->
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">知识管理系统</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/ask">提问</a></li>
                {{if user}}
                 <li class="in dropdown">
                     <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                        role="button" aria-haspopup="true"
                        aria-expanded="false">{{user}}
                         <span class="caret"></span>
                     </a>
                     <ul class="dropdown-menu">
                         <li><a href="/user">个人资料</a></li>
                         <li role="separator" class="divider"></li>
                         <li><a href="/signout">退出</a></li>
                     </ul>
                 </li>
                {{else}}
                <li class="out"><a href="/signin">登录</a></li>
                {{/if}}
                <li><a href="/register">注册</a></li>
            </ul>
        </div>
    </div>
</nav>
<!--正文内容-->
<div class="container questions">
    {{each questions as q}}
    <div class="media" onclick="location.href='/answer/{{q.time | ms}}'">
        <div class="media-left">
            <a>
                <img class="media-object" src="uploads/{{q.petname}}.jpg">
            </a>
        </div>
        <div class="media-body">
            <div class="media-heading">
                <h4>{{q.petname}}</h4>
            </div>
            {{q.content}}
            <div class="media-footing">
                {{q.time | formatTime}}
            </div>
        </div>
    </div>
    {{each q.answers as a}}
    <div class="media">
        <div class="media-body">
            <div class="media-heading">
                <h4>{{a.petname}}</h4>
            </div>
            {{a.content}}
            <div class="media-footing">
                {{a.time | formatTime}}
            </div>
        </div>
        <div class="media-right">
            <a>
                <img class="media-object" src="uploads/{{a.petname}}.jpg">
            </a>
        </div>
    </div>
    {{/each}}
    {{/each}}
</div>
<!--模态框-->
<div class="modal fade bs-example-modal-sm" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog  modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">用户提示</h4>
            </div>
            <div class="modal-body"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>


